<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class PermissionsTableSeeder extends Seeder
{
    public function run()
    {
        $permissions = [
            // 岗位管理权限
            [
                'name' => '列表',
                'slug' => 'list',
                'module' => 'positions',
                'description' => '查看岗位列表',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '查看',
                'slug' => 'view',
                'module' => 'positions',
                'description' => '查看岗位详情',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '创建',
                'slug' => 'create',
                'module' => 'positions',
                'description' => '创建新岗位',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '更新',
                'slug' => 'update',
                'module' => 'positions',
                'description' => '更新岗位信息',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '删除',
                'slug' => 'delete',
                'module' => 'positions',
                'description' => '删除岗位',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            // 题库管理权限
            [
                'name' => '全部题库',
                'slug' => 'allList',
                'module' => 'questions',
                'description' => '查看全部题库列表',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '列表',
                'slug' => 'list',
                'module' => 'questions',
                'description' => '查看题库列表',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '查看',
                'slug' => 'view',
                'module' => 'questions',
                'description' => '查看题目详情',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '创建',
                'slug' => 'create',
                'module' => 'questions',
                'description' => '创建新题目',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '更新',
                'slug' => 'update',
                'module' => 'questions',
                'description' => '更新题目信息',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '删除',
                'slug' => 'delete',
                'module' => 'questions',
                'description' => '删除题目',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            // 招聘管理权限
            [
                'name' => '列表',
                'slug' => 'list',
                'module' => 'recruitment',
                'description' => '查看招聘列表',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '查看',
                'slug' => 'view',
                'module' => 'recruitment',
                'description' => '查看招聘详情',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '创建',
                'slug' => 'create',
                'module' => 'recruitment',
                'description' => '创建新招聘',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '更新',
                'slug' => 'update',
                'module' => 'recruitment',
                'description' => '更新招聘信息',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '删除',
                'slug' => 'delete',
                'module' => 'recruitment',
                'description' => '删除招聘',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '招聘统计',
                'slug' => 'statistics',
                'module' => 'recruitment',
                'description' => '查看招聘统计',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '海报',
                'slug' => 'poster',
                'module' => 'recruitment',
                'description' => '查看招聘海报',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '集合海报',
                'slug' => 'collectionPoster',
                'module' => 'recruitment',
                'description' => '查看招聘集合海报',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '增加浏览量',
                'slug' => 'addViewNumber',
                'module' => 'recruitment',
                'description' => '增加招聘浏览量',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '增加分享量',
                'slug' => 'addShareNumber',
                'module' => 'recruitment',
                'description' => '增加招聘分享量',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '投递简历',
                'slug' => 'submitResume',
                'module' => 'recruitment',
                'description' => '投递简历',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            // 投递简历管理权限
            [
                'name' => '列表',
                'slug' => 'list',
                'module' => 'recruitmentRecords',
                'description' => '查看投递简历',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '更新状态',
                'slug' => 'updateStatus',
                'module' => 'recruitmentRecords',
                'description' => '更新投递简历状态',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '确认已定',
                'slug' => 'confirm',
                'module' => 'recruitmentRecords',
                'description' => '确认已定',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '确定已上船',
                'slug' => 'onboard',
                'module' => 'recruitmentRecords',
                'description' => '确定以上船',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '取消投递',
                'slug' => 'cancel',
                'module' => 'recruitmentRecords',
                'description' => '取消投递简历',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            // 面试管理权限
            [
                'name' => '列表',
                'slug' => 'list',
                'module' => 'interview',
                'description' => '查看面试列表',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '查看',
                'slug' => 'view',
                'module' => 'interview',
                'description' => '查看面试详情',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '更新',
                'slug' => 'update',
                'module' => 'interview',
                'description' => '更新面试详情',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            [
                'name' => '删除',
                'slug' => 'delete',
                'module' => 'interview',
                'description' => '删除面试记录',
                'created_at' => time(),
                'updated_at' => time(),
            ],
            // 用户简历管理
            [
                'name' => '查看简历',
                'slug' => 'resume',
                'module' => 'users',
                'description' => '查看用户简历',
                'created_at' => time(),
                'updated_at' => time(),
            ]
        ];

        DB::table('feehi_permissions')->insert($permissions);
    }
}